<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script type="text/javascript">
/*
*add by kevin 2012-02-02 15:39
*参数：树第一级ul的id
*返回值(数组)：节点1名字:节点1值,节点2名字:节点2值
*/
function getAllCheckedNode(treeUlId){//参数是树第一级ul的id
  var allCheckInput = $("#"+treeUlId).find(".ckbox.checked").find("input");//找到所有打勾input
  var allCheckA = $("#"+treeUlId).find(".ckbox.checked").parent().find("a");//找到所有打勾<a>
  var noteValues="";
  var cityName="";
  var cityNamet="";
  var noteValues="";
  var noteValuest="";
  $(allCheckInput).each(function(i){
  	if(noteValues.length<1024){
  		noteValues+=this.value+",";
		cityName+=this.text+",";
  	}else{
  		noteValuest+=this.value+",";
		cityNamet+=this.text+",";
  	}
  });
  document.getElementById("cName").value = cityName;
  document.getElementById("cNamet").value = cityNamet;
  document.getElementById("cityNum").value = noteValues;
  document.getElementById("cNumt").value = noteValuest;
  var myForm = document.getElementById("myCitytreeForm");
  myForm.action = "<%=basePath%>partition_doCity.action";
  myForm.method='post';
  myForm.onsubmit();
}
</script>
<h2 class="contentTitle">请选择地区</h2>
<form id="myCitytreeForm" method="post" action="" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone)">
<input type="hidden" name="isCityTree" value="yes"/>
<input id="cName" type="hidden" name="cityTreeName"/>
<input id="cNamet" type="hidden" name="cityTreeNamet"/>
<input id="cityNum" type="hidden" name="City_Number"/>
<input id="cNumt" type="hidden" name="City_Numbert"/>
<p>
	<label>&nbsp;&nbsp;&nbsp;&nbsp;分区号：</label>
	<input name="edata" class="required" type="text" size="20" value="${p_Number}"  readonly="true"/>
</p>
</form>
<div id="resultBox"></div>
<div style=" float:left; display:block; margin:10px; overflow:auto; width:360px; height:280px; border:solid 1px #CCC; line-height:21px; background:#FFF;">
<ul id="checkBoxTree" class="tree treeFolder treeCheck expand collapse">
<c:forEach items="${provinces}" var="province">
	<li><a tname="name" tvalue="11111">${province.clinentProvinceName}</a>
		<ul>
			<c:forEach items="${citys}" var="city">
			<c:if test="${city.clinentProvinceNumber == province.clinentProvinceNumber }">
			<li><a tname="name" tvalue="${city.clinentCityNumber }">${city.clinentCityName}</a></li>
			</c:if>
			</c:forEach>
		</ul>
	</li>

</c:forEach>
</ul>
</div>




<div class="formBar" layoutH="50">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="(getAllCheckedNode('checkBoxTree'))">选择地区</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
</div>
